
import java.util.Scanner;

public class Work7 {
    public static void main(String[] args) {
        System.out.println("请输入一个数");
        Scanner scanner=new Scanner(System.in);
        int P =scanner.nextInt();
        int sum=0;
        while(P>=1){
            sum=sum+P%10;
            P=P/10;
        }
        System.out.println("该数每一位相加为"+sum);
    }
}
